package com.zzyl.nursing.controller.member;

import com.github.pagehelper.PageInfo;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import com.zzyl.nursing.vo.NursingProjectVo;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;


@RestController
@RequestMapping("/member/orders/project")
public class MemberNursingProjectController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;


    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> list(@ApiParam("护理项目查询条件") NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }
    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@ApiParam("护理项目ID") @PathVariable("id") Long id) {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }

}
